/*
 *    Copyright 2009-2022 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.apache.ibatis.AAMyDemo.dao;

import org.apache.ibatis.AAMyDemo.domain.Blog;
import org.apache.ibatis.AAMyDemo.domain.MyTest;
import org.apache.ibatis.AAMyDemo.domain.User;
import org.apache.ibatis.AAMyDemo.pagePlugin.Page;
import org.apache.ibatis.annotations.CacheNamespace;

import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author yangSen
 * @Date 2022年03月16日 12:17
 */
@CacheNamespace //开启二级缓存
public interface TestXmlDao {


  /**
   * 使用id查询
   *
   * @param id
   * @return
   */
  MyTest testSelectById(Integer id);

  /**
   * 修改
   *
   * @param id
   * @param name
   * @return
   */
  void updateById(@Param("id") Integer id, @Param("name") String name);

  /**
   * 懒加载测试
   *
   * @param id
   * @return
   */
  Blog selectBlogById(Integer id);

  /**
   * 联合查询
   *
   * @param id
   * @return
   */
  Blog selectBlogById2(Integer id);


  List<User> selectByPage(@Param("page") Page page, @Param("user") User user);


}
